<!DOCTYPE html>
<meta charset=utf-8>
<title>Test for empty plugins and mimeTypes arrays</title>
<link rel='author' title='Mason Freed' href='mailto:masonfreed@chromium.org'>
<link rel='help' href='https://github.com/whatwg/html/issues/6003'>
<script src='/resources/testharness.js'></script>
<script src='/resources/testharnessreport.js'></script>

<script>
test(function () {
  assert_equals(navigator.plugins.length, 0, "Plugins array must be empty");
  assert_equals(navigator.mimeTypes.length, 0, "mimeTypes array must be empty");
  navigator.plugins.refresh();
  assert_equals(navigator.plugins.length, 0, "Plugins array must be empty, even after refresh()");
  assert_equals(navigator.mimeTypes.length, 0, "mimeTypes array must be empty, even after refresh()");
}, "Tests that navigator.plugins and mimeTypes both return empty arrays.");

test(() => {
  const arrayIterator = Array.prototype[Symbol.iterator];
  assert_equals(navigator.plugins[Symbol.iterator], arrayIterator, "plugins array must provide @@iterator");
  assert_equals(navigator.mimeTypes[Symbol.iterator], arrayIterator, "mimeTypes array must provide @@iterator");
  assert_equals(Plugin.prototype[Symbol.iterator], arrayIterator, "Plugin must provide @@iterator");
}, "@@iterator must exist");
</script>
